<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>title</title>
   		<link rel="stylesheet" type="text/css" href="../Ryancss/look_record_list.css"/>
    <style>
		body{

		}
		.list{
		}
		.list li{
			box-sizing: border-box;
			height:73px;
			width:100%;
			border-bottom:1px solid #f0f0f0;
			padding-left:80px;
		}
		.left{
			float:left;
			width:80px;
			height:100%;
			margin-left:-80px;
		}
		.logo_frame{
			width:46px;
			height:46px;
			margin-top:17px;
			margin-left:17px;
			overflow: hidden;
		}
		.logo_frame img{
			width:100%;
		}
		.info{
			float:left;
			width:100%;

		}
		.list_title{
			box-sizing: border-box;
			padding-right:10px;
			margin-top:8px;
			width:95%;
			overflow:hidden;
			font-size:15px;
			line-height:40px;
			font-family: '黑体';
			min-height:40px;

		overflow: hidden;
		text-overflow: ellipsis;
		white-space:nowrap;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		}
		.list_date{
			margin-top:0px;
			font-size:14px;
			color:#767676;
		}
		.empty{
			width:100%;
			height:30px;
			line-height:20px;
			font:14px;
			text-align:center;
			margin-top:10px;

		}


	/*新加空提示信息*/

	.m-noRecord {
    padding: .395rem 0 0;
    text-align: center;
}

.m-noRecord .c-icon-noRecord {
    background: url() no-repeat;
    background-size: cover;
		width: 5rem;
    height: 4.6rem;
    /* margin: .485rem auto 0; */
    margin: 0 auto;
	  margin-top: 50px;
		opacity:0.4;    /*图片透明度*/
		filter:alpha(opacity=40); /* 针对 IE8 以及更早的版本 */
}
.m-noRecord .c-info {
    color: #cecfce;
    line-height: 4rem;
    padding: .25rem 0;
    font-size: .8rem;
}




	


	   .display-block{
	   display :block ;
	   }
	   
	   .display-none{
	   display :none ;
	   }
	   

    </style>
</head>
<body>



        <section class="aui-flexView">

            <section class="aui-scrollView">


				<div class="display-none" id="display-block-look_record_num">
					<div style="box-shadow: 0 1px 25px #f4f4f4; border-radius: 8px; padding: 5px 10px;margin: 10px 15px 10px 15px; border: 1px solid #f0f0f2;    display: -webkit-box; display: -webkit-flex; display: flex; -webkit-box-align: center; -webkit-align-items: center; align-items: center; padding: 15px; position: relative;">
						<div style="width: 30px;">
							<img src="" style="width: 100%; height: auto; display: block; border: none;">
						</div>
						<div class="aui-flex-box">
							<h4 style="color: #cecfce;"> 为您保留最近<b id="look_record_num"><!--调用数量--></b>次全网影视观看记录</h4>
						</div>
		
					</div>
					
			   </div>				
				
				
                <div class="aui-expert-list"  id="list" >

				<script id="list_template" type="text/x-dot-template">

								<a class="aui-flex">
								<div class="aui-expert-user">
									<img src="{{=it.logo}}" >
								</div>
								<div class="aui-flex-box">
									<h1>{{=it.title}}</h1>
									<p>{{=it.date_str}}</p>
									<span><em>来源：{{=it.ping}}</em></span>
									
								</div>
								<div class="aui-expert-chat"   onclick="jiexi_play('{{=it.url}}', '{{=it.title}}');"  >
									<div class="aui-arrow-text">
										<h1>播 放</h1>
									</div>
								</div>
							</a>		
					
					
					
					
				</script>
				
				
				

                  
                </div>
            </section>
        </section>





</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/zepto.js"></script>
<script type="text/javascript" src="../script/doT.js"></script>
<script type="text/javascript" src="../script/date.min.js"></script>
<script type="text/javascript">
  var api_url = localStorage.getItem('api_url');
    var jx_url1 = localStorage.getItem('jx_url1');
	var list_template;
	apiready = function(){
		list_template = $("#list_template").text();
		update();

	};

	function update(){
		api.ajax({
	        url: api_url+'/login/login/newjilu?uid=' + localStorage.getItem('user_id')
        },function(ret,err){
		
		
        	//coding...
        	if(ret.code==0){
        		//$("#list").empty();
      //  		$("#list").html('<div  class="empty">'+ ret.msg +'</div>');
 		$("#list").html('<section class="m-noRecord"><div class="c-icon-noRecord"></div> <div class="c-info">'+ ret.msg +'</div></section>'); 



        		return;
        	}


				localStorage.setItem('look_record_num',ret.num);   //调用数量
				
			if(localStorage.getItem('look_record_num') ==''){        //如果调用数量为空
			
			}else{
			
			
								var obj = document.getElementById("display-block-look_record_num");
								obj.setAttribute("class", "display-block");
								
								look_record_num.innerHTML = localStorage.getItem('look_record_num');
			
			}
			
			
			




        	var array = ret.msg;
        	//alert(JSON.stringify(ret));
        	for(var i=0;i<array.length;i++){
        		var p = array[i];
        		      if(p.ping =="优酷"){
        			p["logo"] = ""
					
        		}else if(p.ping == "爱奇艺"){
        			p["logo"] = ""
					
      			}else if(p.ping == "腾讯"){
        			p["logo"] = ""
					
				}else if(p.ping == "搜狐"){
							p["logo"] = ""
				
				}else if(p.ping == "PPTV"){
							p["logo"] = ""
				
				}else if(p.ping == "芒果"){
							p["logo"] = ""
				
				}else if(p.ping == "M1905"){
							p["logo"] = ""
				
				}else if(p.ping == "暴风"){
							p["logo"] = ""
				
				}else if(p.ping == "乐视"){
							p["logo"] = ""
				
				}else if(p.ping == "风行"){
							p["logo"] = ""
				
				}else if(p.ping == "未知"){
							p["logo"] = ""
        		}
        		var date_str = "";
        		try{
        			var date = new Date();
        			date.setTime(p.time*1000);
        			date_str = date.format('MM-dd hh:mm');
        		}catch(e){
        		}
        		p["date_str"] = date_str;

        	}

	   		var text = "";

			for(var i=0;i<array.length;i++){
				var p = array[i];
				text = text + doT.template(list_template)(p);
			}
			$("#list").html(text);


        });
	}







//打开播放记录
	function jiexi_play(dataurl2, page_title){

    var time = localStorage.getItem('user_time');
    var user_id = localStorage.getItem('user_id');
    var username = localStorage.getItem('user_name');
    var timestamp = Date.parse(new Date())/1000;
    if(user_id<1){
   /*   api.alert({
          title: '温馨提示',
          msg: '请先登陆后使用',
	  */
      api.openWin({    

          name: 'login',
          url: './login.html',
          delay: 300,
	//	    });
					
											
						
				bounces: false,
				slidBackEnabled: true,
				bgColor: '#000',
				animation: {
					type: "reveal", //动画类型（详见动画类型常量） 
					subType: "from_right", //动画子类型（详见动画子类型常量）
					duration: 400
				},
				vScrollBarEnabled: false
						
						
      });
      return;

    }

    if (time>timestamp) {
      api.showProgress({
          title: 'VIP登录中...',
          modal: false
      });
      setTimeout("playRadio();",1000);
      var delay = 0;
      if(api.systemType != 'ios'){
          delay = 300;
      }


		api.hideProgress();


			
	
		api.openWin({
           name: 'video_jiexi_play_win',
           url: './video_jiexi_play_win.html',
           delay: 300,
           pageParam:{
           		url:jx_url1+dataurl2,
           		srcUrl:dataurl2,
           		title:page_title,
           		needRecordHistory: false
           	},
           //pageParam:{url:dataurl2},
           bgColor: '#000000'
       });
	   
	   



    }else if (time == -1) {
      api.showProgress({
          title: 'VIP登录中...',
          modal: false
      });
      setTimeout("playRadio();",2000);
      var delay = 0;
      if(api.systemType != 'ios'){
          delay = 300;
      }
	  
	  
		api.hideProgress();
	  

				
	
		api.openWin({
           name: 'video_jiexi_play_win',
           url: './video_jiexi_play_win.html',
           delay: 300,
           pageParam:{
           		url:jx_url1+dataurl2,
           		srcUrl:dataurl2,
           		title:page_title,
           		needRecordHistory: false
           	},
           //pageParam:{url:dataurl2},
           bgColor: '#000000'
       });
	   
	   


    }else if (time<timestamp){
	
	
			VipExpiredHint();   //会员过期提示
		  
    }

  }

	  
		  

 //  会员过期 弹窗提示
 function VipExpiredHint(){
 
	var dialogBox = api.require('dialogBox');
	dialogBox.alert({
	tapClose:true,			//允许点击遮罩关闭弹窗
    texts: {  
        title: '操作失败',
        content: '您的超级会员已过期',   //调用后台设置内容
        leftBtnTitle: '等下',
        rightBtnTitle: '升级'
    },
    styles: {
			bg: '#fff',
			w: 300,
			corner:10,
			title: {
				marginT: 20,
				icon: 'widget://Ryanimg/frame0/rrrr.png',
				iconSize: 20,
				titleSize: 14,
				titleColor: '#999'
			},
			content: { 
				marginT: 20,       //（可选项）数字类型；内容文本顶端与标题栏底端的距离，如果标题栏不存在，则是到窗口顶端的距离；默认：20
				marginB: 20,       //（可选项）数字类型；内容文本底端与 left/right 顶端的距离，如果 left/right 都不存在，则是到对话框底端的距离；默认：20
				color: '#999',
				size: 14 
			},
			left: {
				marginB: 30,
				marginL: 30,
				w: 100,
				h: 35,
				corner: 2,
				bg: '#eeeeee',
				color: '#999',  //（可选项）字符串类型；右边按钮标题字体颜色，支持rgb、rgba、#；默认：'#007FFF'
				size: 12
			},
			right: {
				marginB: 30,
				marginL: 40,
				w: 100,
				h: 35,
				corner: 2,
				bg: '#ff1679',
				color: '#fff',  //（可选项）字符串类型；右边按钮标题字体颜色，支持rgb、rgba、#；默认：'#007FFF'
				size: 12
			}
			
			
		
		}
	}, function(ret) {
						
																			
					if (ret.eventType == 'left') {
						var dialogBox = api.require('dialogBox');
						dialogBox.close({
							dialogName: 'alert'
						});
					} else if(ret.eventType == 'right') {
																			
						api.openWin({
						name: 'upgrade_vip_win',
						url: './upgrade_vip_win.html',
						delay: 300
					});
																					     
							    
						var dialogBox = api.require('dialogBox');
						dialogBox.close({
						dialogName: 'alert'
						});
																					
					}
				});
 
 }
 








</script>
</html>
